<?php
/**
* alltosun.com 核销记录列表接口 index.php
* ============================================================================
* 版权所有 (C) 2009-2014 北京互动阳光科技有限公司，并保留所有权利。
* 网站地址: http://www.alltosun.com
* ----------------------------------------------------------------------------
* 许可声明: 这是一个开源程序，未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
* ============================================================================
* $Author: 高昂 (gaoa@alltosun.com) $
* $Date: 2015-7-3 上午9:42:33 $
* $Id$
*/

class Action
{
    private $token     = '';
    private $user_id   = 0;
    private $user_info = array();
    //核销类型
    private $type = '';

    public function __construct()
    {
        $this->token             = an_request('token');

        if ($this->token) {
            $user_info = user_helper::get_user_info_by_token($this->token);
            if ($user_info && $user_info['status'] == 1) {
                $this->user_id   = $user_info['id'];
                $this->user_info = $user_info;
            }
        }
    }

    /**
    * 获取核销记录列表
    */
    public function get_store_verify_vocher_list()
    {
        //an_dump($_POST);
        $group_platform_id = Request::getParam('group_platform_id', 0);
        $type              = Request::getParam('type', '');
        $page_no           = Request::getParam('page_no', 1);
        
        $check_params = array(
        	   'group_platform_id' => $group_platform_id,
               'type'              => $type,
               'page_no'           => $page_no 
        );
        
        // 验证接口
        $api_stat_id = api_helper::check_sign($check_params, 1);

        if (!$this->user_id) {
            api_helper::return_data(1, '请先登录');
        }

        $store_verify_vocher_list = _widget('store_verify_vocher_record')->get_store_verify_vocher_list($this->user_id,$group_platform_id, $type, $page_no);

        if ($store_verify_vocher_list) {
            api_helper::return_data(0, 'success', $store_verify_vocher_list, $api_stat_id);
        } else {
            api_helper::return_data(1, '暂无核销记录');
        }

    }


}

?>